<html>
<head>
   <script src="../../Grid/GridE.js"> </script>
</head>
<body class="Tutorial">
   <style>
      /* Tutorial shared styles */
      .Tutorial h1,.Tutorial h2,.Tutorial ul,.Tutorial .Desc,.Tutorial .Path,.Tutorial .Xml { max-height:999999px; }
      .Tutorial h1 { font:30px Arial; padding:5px 0px 5px 0px; margin:0px; text-align:center; }
      .Tutorial h2 { font:15px Arial; padding:0px; margin:0px 0px 10px 0px; text-align:center; color:#757575; }
      .Tutorial h3,.Tutorial h4 { display:inline-block; font:bold 15px Arial; padding:0px 5px 0px 5px; border-radius:2px; color:black; margin:2px; font-style:normal; color:#333; }
      .Tutorial h3 { background:#EE9; border:1px solid #DD8; }
      .Tutorial h4 { background:#BDE; border:1px solid #ACD; }
      .Tutorial a { text-decoration:underline; }      
      .Tutorial li { padding-bottom:8px; }
      .Tutorial ul { margin:6px 0px 0px 20px; font:13px Arial; }
      .Tutorial > ul { margin-left:0px; padding-left:15px; clear:both; }
      .Tutorial ul b { color:#0585B9; }
      .Tutorial .Path { font:normal 12px Arial; color:#0585B9; }
      .Tutorial .Path b { color:#D73938; }
      .Tutorial .Path u { text-decoration:none; color:black; font-weight:bold; padding:0px 2px 0px 2px; }
      .Tutorial .Xml { margin-bottom:6px; font-size:12px; color:#757575; }
      .Tutorial .Border { border:1px solid #dfdfdf; padding:10px 20px 10px 20px; margin:0px 8px 20px 0px; min-width:100%; box-sizing:border-box; }
      .Tutorial .Main { }
   </style>

   <center class="Path"><script>document.write(location.href.replace(/(.*)(\/Tutorials\/)([^\/]+)\/([^\/]+)$/,"$2<b>$3</b>/$4").replace(/([^<]|^)(\/|\.)/g,"$1<u>$2</u>"));</script></center>
   <h1>1. Calendars - excluded dates</h1>
   <h2>Excluding any dates from chart and Gantt calculation</h2>

   <center class="Border" id="Border">
      <div class="Xml">Source: <a href='01-Calendars_exclude.js'>01-Calendars_exclude.js</a></div>
      <div class="Main" style='width:100%; height:538px;'>
         <bdo Debug='check' Data_Url='01-Calendars_exclude.js'></bdo>
      </div>
      <br /> <br />
      <div class="Xml">Source: <a href='01-Calendars_exclude-Numbers.js'>01-Calendars_exclude-Numbers.js</a></div>
      <div class="Main" style='width:100%; height:481px;'>
         <bdo Debug='check' Data_Url='01-Calendars_exclude-Numbers.js'></bdo>
      </div>
   </center>

   <ul>
      <li>
         Available calendars in chart are defined in root <h3>Calendars</h3> tag, by individual <h3>E</h3> tags.<br />
         Every calendar has defined its <b>Name</b> and all dates to exclude in <b>Exclude</b> tag.<br />
         The calendars are accessible also by API by <b>Calendars</b> array.<br />
      </li>

      <li>
         The <h4>format</h4> of <b>Exclude</b> or <b>GanttExclude</b> is: <b>rep1#date1a~date1b;rep2#date2a~date2b;...</b><br />
         The <b>repeater</b> can be one of GanttDataUnits. If it is missing, the date is not repeated. The date is repeated also before it.<br />
         For example: GanttExclude = 'w#1/5/2008~1/7/2008; d#00:00~9:00; d#13:00~14:00; d#18:00~24:00' shows only hours 8:00 - 13:00 and 14:00 - 18:00 and only workdays.<br />
      </li>

      <li>
         The excluded dates are completely ignored in Gantt calculation, they behave like there are no such dates at all.<br />
      </li>
      <li>
         If the excluded dates are shown, they are colored in different color and usually do not permit to place objects here, see <b>GanttCheckExclude</b>.
         The excluded dates are color before background, so by GanttBackground is possible to change their color.<br />
      </li>
      <li>
         <h3>GanttCheckExclude</h3> attribute controls if it will be possible to place some objects to excluded dates.<br />
         <i>Remember, even if the object contains excluded dates, they are still excluded from all calculations, like dependency or duration.</i><br />
         The checking affects also editing Gantt source columns by a user.<br />
         0 - permits placing, 1 - restricts placing, 2 - asks user.
      </li>

      <li>
         <h4>Global calendar</h4> is defined by <h3>GanttExclude</h3> tag. It affects all rows without local calendar.<br />
         The GanttExclude can be set to the name of calendar defined in <b>Calendars</b> tag or directly to exclude string.<br />
         The excluded dates by global calendar can be shown or hidden in the chart, according to <h3>GanttHideExclude</h3> value.<br />
         Dynamically can be the GanttHideExclude changed by API method <b>SetHideExclude</b>.<br />
      </li>

      <li>
         <h4>Local calendars</h4> can be defined individually for every row by <h3>GanttCalendar</h3> attribute.<br />
         The GanttCalendar can be set for the whole column to another grid column that contains calendar names or direct exclude strings.<br />
         Or can be set individually for every row to the calendar name, exclude string or the column containing this information. In this case the Gantt column must have set the GanttCalendar attribute to some value too.<br />
      </li>

      <li>
         <b>ShowGanttCalendar</b> API method presets cell Defaults list to the list of calendar to let users to choose and assign a calendar to the local or global calendar.<br />
         It can be used in <b>OnClickSideDefaults</b> event.
      </li>

      <li>
         <b>EditGanttCalendars</b> API method shows the global dialog to let users to edit, add and delete available calendars.<br />
      </li>

      <li>
         If the calendar changes, the bars in rows must be recalculated. It is possible to recalculate bar duration according to its end or its end according to the duration.<br />
         For main bar it is chosen by <b>GanttChangeExclude</b> attribute. The Run bars change depends if the bars are defined by width or by end.<br />
      </li>

      <li>
         The calendar be changed and updated also by API method <b>ChangeExclude</b>.
      </li>
   </ul>

   <!-- Google Analytics code run once for trial -->
   <script>
      var TGTrial = document.cookie.match(/TGTrialGantt\s*=\s*(\d+)/), TGIndex = 1;
      if(!TGTrial||!(TGTrial[1]&TGIndex)) setTimeout(function(){
         var n = "RunTrialGridCalendars1", d = (new Date((new Date).getTime()+31536000000)).toUTCString(); document.cookie = "TGTrialGantt="+((TGTrial?TGTrial[1]:0)|TGIndex)+";expires="+d;
         var u = document.cookie.match(/TGTrialUsed\s*=\s*(\d+)/); u = u ? u[1]-0+1 : 1; if(u<=11) document.cookie = "TGTrialUsed="+u+";path=/;expires="+d;
         var s = "<div style='width:0px;height:0px;overflow:hidden;'><iframe src='http"+(document.location.protocol=="https"?"s":"")+"://www.treegrid.com/Stat/GA.html?productName="
               +(u==1||u==3||u==5||u==10?"UsedTrial"+u:n)+"' onload='var T=this;setTimeout(function(){document.body.removeChild(T.parentNode.parentNode);},1000);'/></div>";
         var F = document.createElement("div"); F.innerHTML = s; document.body.appendChild(F);
         },100);
   </script>
</body>
</html>